package com.lhc.storm.drpc.hadoop;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * RPC 客户端
 */
public class RPCClient {

    public static void main(String[] args) throws IOException {

        Configuration configuration = new Configuration();
        long clientVersion = 12345678l;
        UserService userService = RPC.getProxy(UserService.class, clientVersion,
                new InetSocketAddress("localhost", 9999), configuration);
        userService.addUser("zhangsan", 30);
        System.out.println("From client... invoker");
        RPC.stopProxy(userService);
    }
}
